<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <script src="js/vue.js"></script>
        <script src="js/axios.min.js"></script>
    </head>
    <body>
        <div id="app">
            <form action="/html/store.html">
                &emsp;用户名：<input type="text" v-model="username"><br>
                用户密码：<input type="text" v-model="password"><br>
                <input type="button" @click="Login()" value="登录">
            </form>
        </div>

    </body>
</html>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            username: "",
            password: "",
        },
        methods: {
            Login() {
                axios.get("http://127.0.0.1:8088/login").then(function(res) {
                    console.log(res.data.code)
                    if (res.data.code == 200) {
                        alert("登录成功")
                        ref.url = "store.html"
                        return
                    } else {
                        alert(res.data.msg)
                    }
                })
            },
        },
    })
</script>